<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">
<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>








<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT" />










<meta name="description" content="MUGEN1.X FNTV2 Bitmap运用实例">
<meta property="og:type" content="article">
<meta property="og:title" content="1.X场景预览图代替文字教程">
<meta property="og:url" content="https://kfm.ink/cjmfrxr0c0000l2b7jt16w565/index.html">
<meta property="og:site_name" content="白绝">
<meta property="og:description" content="MUGEN1.X FNTV2 Bitmap运用实例">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://i.loli.net/2018/09/22/5ba5a68b0ee8d.jpg">
<meta property="og:updated_time" content="2018-09-22T02:20:54.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="1.X场景预览图代替文字教程">
<meta name="twitter:description" content="MUGEN1.X FNTV2 Bitmap运用实例">
<meta name="twitter:image" content="https://i.loli.net/2018/09/22/5ba5a68b0ee8d.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://kfm.ink/cjmfrxr0c0000l2b7jt16w565/"/>





  <title>1.X场景预览图代替文字教程 | 白绝</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">白绝</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">WhiteJue</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://kfm.ink/cjmfrxr0c0000l2b7jt16w565/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="白绝">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="白绝">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">1.X场景预览图代替文字教程</h1>
        

        <div class="post-meta">
          
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-09-22T09:52:21+08:00">
                2018-09-22
              </time>
            

            

            
          </span>

          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/cjmfrxr0c0000l2b7jt16w565/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count valine-comment-count" data-xid="/cjmfrxr0c0000l2b7jt16w565/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>MUGEN1.X FNTV2 Bitmap运用实例<br><a id="more"></a></p>
<h3 id="位图字体"><a href="#位图字体" class="headerlink" title="位图字体"></a>位图字体</h3><p>FNTV2字体有两种类型，一种是矢量字体类型，一种是位图字体类型，前者的运用可以看之前的中文化教程<br>今天要说的是后者，为了让大家了解什么是位图字体类型，在说之前我们还得讲讲古老的FNTV1，即win版时所使用的.fnt字体，FNTV1是单纯的位图字体，实际上由两部分组成。<br>第一部分是字体属性，内容大致如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">[Def]</span><br><span class="line">Size = 4,6</span><br><span class="line">Spacing = 0,0</span><br><span class="line">Colors = 1</span><br><span class="line">Offset = 0,0</span><br><span class="line">Type = Variable</span><br><span class="line">[Map]</span><br><span class="line">A 0 4</span><br><span class="line">B 4 4</span><br><span class="line">C 8 4</span><br><span class="line">D 12 4</span><br><span class="line">E 16 4</span><br><span class="line">F 20 4</span><br><span class="line">G 24 4</span><br><span class="line">;以下省略……</span><br></pre></td></tr></table></figure>Def下，Size和Spacing是字体大小和字间距，而Offset是字体坐标，Type为无效参数，Colors参数较复杂暂时不讲<br>而Map下则是字符到位图的映射，它的格式是“C X W”，其中C是字符，X是映射的起始横坐标，而W是映射的宽度<br>那么既然是字符到位图的映射，自然就有位图了，也就是第二部分，它（必须）是一张具有色表的PCX图片，例如（点击放大）：<br><img src="https://i.loli.net/2018/09/22/5ba5a68b0ee8d.jpg" alt=""><br>在这张图片中，横向排行一列字符的图像，当MUGEN检测到字符时，首先从Map中获取对应的映射，比如遇到“A”，就找到A对应的映射“A 0 4”<br>然后在这张PCX图片中截取一部分，即从横坐标0开始，截取宽度为4的部分，然后在对应位置显示这一部分的图像，这就是位图字体的基本原理。<br>知道了原理之后，应该就能明白位图字体类型的优劣，它常常用于少量的彩图字体制作，因为对于位图字体来说，作者需要为每一个字符制作对应的图片，一旦字符量过多，工作量就会非常大，而矢量字体类型就解决了这一问题，但矢量字体类型并不适合显示彩图字体。<br>那么我们就得讲讲FNTV1的劣势：<br>首先，FNTV1没有提供映射的起始纵坐标这一属性，所以作者制作的PCX图片必须是<strong>单行</strong>横向排列字符的，一旦字符过多的话图片宽度也会很大；<br>其次，FNTV1是单张图像作为映射集合，即作者制作完每个字符对应的图片后，需要将其横向合并，而且还得考虑每个字符图像对应的宽度和起始横坐标；<br>最后，由于FNTV1的各种自身因素导致不能很方便地对它进行制作和修改。<br>所以，FNTV2出现了，它很大部分地解决了FNTV1的弊端，但尽管如此，FNTV1仍然有不少画面包在使用，有两个原因：第一是Win版盛行，第二是FNTV2相关的文档很少，这也是我写这篇教程的原因。</p>
<h3 id="FNTV2-Bitmap"><a href="#FNTV2-Bitmap" class="headerlink" title="FNTV2-Bitmap"></a>FNTV2-Bitmap</h3><p>“FNTV2-Bitmap”以下简称为“V2”<br>V2的原理和FNTV1大致相同，但V2不再是单个文件，而是有一个Def文件和一个SFF文件，即用Def文件定义字体属性，然后用SFF文件储存映射图像<br>由于采用SFF，所以映射图像不需要再合并为一张了，也不需要考虑宽度和起始横坐标了，而且更不存在制作不方便的问题了，因为我们有强大的FF，而且我们还能在SFFV2.01使用RGB图像来映射。<br>Def文件的内容大致如下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">[FNT v2]</span><br><span class="line">fntversion = 2,00</span><br><span class="line">name = &quot;&quot;</span><br><span class="line">[Def]</span><br><span class="line">Type = bitmap</span><br><span class="line">BankType = sprite</span><br><span class="line">Size = 70,71</span><br><span class="line">Spacing = 0,1</span><br><span class="line">Offset = 0,3</span><br><span class="line">File = num72.sff</span><br></pre></td></tr></table></figure>这里Type为bitmap表示为位图字体类型，File为映射图像所在的SFF文件名，BankType参数较为复杂暂时不讲。如果你仔细观察的话，会发现V2的Def文件并没有像FNTV1那样有一个Map块来定义字符到图像的映射，实际上由于使用这种方法来定义映射的话很麻烦，所以V2并没有采取这种方法，而是利用了一种字符编码来映射，那就是ASCII<br>ASCII是一种字符到数字的映射，即规定了每一个字符都有一个唯一的对应的数字，那么具体的可以看ASCII表：<a href="http://tool.oschina.net/commons?type=4" target="_blank" rel="noopener">http://tool.oschina.net/commons?type=4</a><br>需要注意的是，ASCII是区分大小写的，即大小写分别映射不同的数字，ASCII所包含的字符大多是现代英语。<br>那么MUGEN检测到字符时，首先从ASCII中获取字符串所映射的数字，得到了数字后如何根据这个数字获取到字符的图像呢？这时候SFF发挥了作用，在SFF中每一个图像都有一个组号和索引号，索引号此时充当ASCII码，而组号一般情况下默认写0<br>比如“A”的ASCII码为65，那么就会显示SFF中组号为0，索引号为65的图像，这就是V2的基本原理，即字符——ASCII——图像。</p>
<p>这里以一个典型的运用为例，即选人界面显示场景预览图而非场景文字，首先思路是很明确的，既然位图字体是字符到图像的映射，那我们只需要先提前准备场景的预览图（自己截图，建议使用VSMan），<br>然后修改场景文件名，比如修改为A.def，那么此时被映射的字符为“A”，则将这张场景的预览图以组号0、索引号65加入到SFF中，之后按照此方法弄好字体的Def和SFF，之后在system.def添加此位图字体，然后根据自己的情况定义以下参数：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">stage.pos = 640,700</span><br><span class="line">;显示坐标</span><br><span class="line">stage.active.font = 1,0,0</span><br><span class="line">;焦点字体1</span><br><span class="line">stage.active2.font = 1,2</span><br><span class="line">;焦点字体2</span><br><span class="line">stage.done.font = 1,0</span><br><span class="line">;选中字体</span><br></pre></td></tr></table></figure>这里的焦点字体有两个，一般情况下字体设置为一样的就行，当然你也可以设置为不同的字体，MUGEN会不断交替使用两种字体达到闪烁的效果。当你做好了这些以后，还有一件事就是校对坐标，有三种方法：1.修改上面的stage.pos参数，2.修改字体Def中的Offset参数，3.修改SFF中的图片坐标<br>到了这里，V2最基本的操作已经结束了，当然还有一些更进阶的用法，以后有时间再写吧。</p>

      
    </div>
    
    
    
    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/cjmfrxr0y0003l2b71wkhremu/" rel="next" title="1.X主程序完全中文化教程">
                <i class="fa fa-chevron-left"></i> 1.X主程序完全中文化教程
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">白绝</p>
              <p class="site-description motion-element" itemprop="description">白绝的个人博客</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">10</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#位图字体"><span class="nav-number">1.</span> <span class="nav-text">位图字体</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#FNTV2-Bitmap"><span class="nav-number">2.</span> <span class="nav-text">FNTV2-Bitmap</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">白绝</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  










  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item=>{
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: '4igPJ1aughhjJwJTvNXdofSx-gzGzoHsz',
        appKey: 'Hh4A6qHvsCaIjGuyi9kKCqKI',
        placeholder: '你的邮箱将严格保密！',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  

  

  
  

  

  

  

</body>
</html>
